﻿<Window x:Class="SLS.Client.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:exc="clr-namespace:SLS.Controls;assembly=CLSControls"
                     xmlns:converters="clr-namespace:SLS.ExClassLib.Converters;assembly=Converters"
                     xmlns:exd="clr-namespace:SLS.DataBase;assembly=CLSDB"
                     xmlns:gui="clr-namespace:SLS.Presentation;assembly=GeneralGUI"
                     xmlns:mnu="clr-namespace:SLS.Presentation;assembly=MenuBuildVW"
                     xmlns:events="clr-namespace:SLS.ExClassLib.Events;assembly=CLSEvents"
                     xmlns:nvp="clr-namespace:Stema.Controls;assembly=NavigationPane"
                     xmlns:CinchV2="clr-namespace:Cinch;assembly=Cinch.WPF"
                     xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"
                     ResizeMode="CanResizeWithGrip"
                     WindowStartupLocation="CenterScreen"
                     x:Name="Container"
                     Title="MainWindow"
                     WindowState="Maximized"
                     Loaded="OfficeWindow_Loaded"
                     Icon="Resources\LanSunERPStudio.ico"
                     meffed:ViewModelLocator.ViewModel="MainWindowViewModel"
                     >
    <Window.Resources>
        <DataTemplate DataType="{x:Type CinchV2:WorkspaceData}">
            <Border HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    CinchV2:NavProps.ViewCreator="{Binding}" />
        </DataTemplate>
    </Window.Resources>
    <Grid  Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>     
            <DockPanel  Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                >
            <nvp:NavigationPane DockPanel.Dock="Left"
                                x:Name="navigationPane"
                                SelectedIndex="0"
                                LargeItems="2"
                                Margin="2,0,0,1"
                                IsMinimized="False"
                                VerticalAlignment="Stretch"
                                MaxWidth="300"
                            Width="200">
                <nvp:NavigationPaneItem Header="菜单"
                                    Image="Resources/Images/16x16/open.png"
                                    Name="oldMenu">
                    <mnu:ExpMenuBuild Name="MainMenu"
                                  Width="Auto"
                                  MaxWidth="300"
                                  Height="Auto"
                                  MaxHeight="500" />
                </nvp:NavigationPaneItem>
                <nvp:NavigationPaneItem Header="新菜单"
                                    Image="Resources/Images/16x16/open.png"
                                    Name="intro">
                    <Menu x:Name="menuMainWindow"
                      Margin="0,0,0,0"
                      Height="Auto"
                      Foreground="Black"
                      ItemContainerStyle="{StaticResource WPFMenuItemStyle}"
                      ItemsSource="{Binding MainWindowOptions}"
                      BorderBrush="Transparent"
                      VerticalAlignment="Top"></Menu>
                </nvp:NavigationPaneItem>
                <nvp:NavigationPaneItem Header="树状">
                    <TreeView Grid.Row="0"  HorizontalAlignment="Stretch" 
                                          Margin="0,0,0,0" Name="treeViewReport" 
                                          VerticalAlignment="Stretch" 
                                          SelectedItemChanged="treeViewReport_SelectedItemChanged">
                        <TreeViewItem Header="工艺开发" Tag="HomeTech" Name="ttabArticle"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="生产开发工艺"  Name="tgpArticle">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="单证"  Name="tgpDoc"   IsEnabled="False" Visibility="Hidden" >
                            <TreeViewItem Header="生产"  Name="tgpProd"    IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                            <TreeViewItem Header="销售"  Name="tgbSales"   IsEnabled="False" Visibility="Hidden" >
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="销售部" Name="ttabSales"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="销售部" Name="tgpSales"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="计划部"  Name="ttabPlan"   IsEnabled="False" Visibility="Hidden" >
                            <TreeViewItem Header="计划部"  Name="tgpPlan"   IsEnabled="False" Visibility="Hidden" >
                            </TreeViewItem>
                            <TreeViewItem Header="原料供应"  Name="tgpMaterilaSupply"   IsEnabled="False" Visibility="Hidden" >
                            </TreeViewItem>
                            <TreeViewItem Header="仓库"  Name="tgpMaterial"   IsEnabled="False" Visibility="Hidden" >
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="统计" Name="ttabChart"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="浆纱" Name="tgpSizing"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                            <TreeViewItem Header="染纱" Name="tgpDye">
                            </TreeViewItem>
                            <TreeViewItem Header="生产" Name="tgpProduction">
                            </TreeViewItem>
                            <TreeViewItem Header="产量" Name="tgpOutput">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="采购部" Name="ttabPurchase"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem  Header="采购部" IsEnabled="False" Name="tgpEK" Visibility="Hidden"  >
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="仓库" Name="ttabWarehouse"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="仓库报表"  Name="tgpWarehouse" Tag="HomeWB"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="质检" Name="ttabQuality"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="坯布" Name="tgpWS03"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="英邦" Name="ttabYingbang"  IsEnabled="False" Visibility="Hidden">

                        </TreeViewItem>
                        <TreeViewItem Header="财务" Name="ttabFinance"  IsEnabled="False" Visibility="Hidden">
                            <TreeViewItem Header="进销存" Name="tgpINOUTINV"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                        </TreeViewItem>
                        <TreeViewItem Header="系统设定"  IsEnabled="False" Visibility="Hidden" Name="ttabSystem">
                            <TreeViewItem Header="系统"  IsEnabled="False" Visibility="Hidden">
                            </TreeViewItem>
                        </TreeViewItem>
                    </TreeView>
                </nvp:NavigationPaneItem>
            </nvp:NavigationPane>
            <exc:ExTabControl x:Name="TAB_MAIN"
                            VerticalAlignment="Stretch"
                              HorizontalAlignment="Stretch"
                          ItemsSource="{Binding Documents}"
                          TabStripPlacement="Top"
                          CinchV2:NavProps.ShouldHideHostWhenNoItems="true"
                          ItemContainerStyle="{StaticResource TabItemStyleTopTabs}"
                          Style="{StaticResource TabControlStyleTopTabs}"
                          IsSynchronizedWithCurrentItem="True"
                          DisplayMemberPath="DisplayText"
                          BorderBrush="#FF656565"></exc:ExTabControl>
        </DockPanel>
        <Fluent:Ribbon Grid.Row="0"
                DockPanel.Dock="Top"
                        HorizontalAlignment="Stretch"
                        Name="ribbonMain"
                        Width="Auto"
                        Background="Red"
                        AutomaticStateManagement="True"
                        Title="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=Title}">
                <!--################   project tab   ################-->
                <Fluent:Ribbon.Menu>
                    <Fluent:Backstage IsEnabled="True" Visibility="Visible"  Name="bkMain"  Background="Green" Header="文件">
                        <Fluent:BackstageTabControl>
                            <Fluent:Button Header="重置功能表"  IsEnabled="True" Visibility="Visible"  Name="btnUserSetUp"
                                       Click="btnUserSetUp_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" />
                            <Fluent:Button Header="INTEX"  IsEnabled="True" Visibility="Visible"  Name="btnINTEX"
                                       Click="btnINTEX_Click"
                                       SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\keys.png"
                               LargeIcon="Resources\Images\32x32\folders\keys.png" />
                            <Fluent:Button Header="连接到数据库"  IsEnabled="False" Visibility="Hidden"  Name="Connect2DBMenu"
                                       Click="Connect2DBMenu_Click"
                                        SizeDefinition="Small"
                               Icon="Resources\Images\16x16\folders\open_folder.png"
                               LargeIcon="Resources\Images\32x32\folders\open_folder.png" />
                            <Fluent:Button Header="改变数据库" Command="Save" IsEnabled="False" Visibility="Hidden"  Name="Save"
                                       Icon="Resources\Images\32x32\application\save.png"
                                       LargeIcon="Resources\Images\32x32\application\save.png" />
                            <Fluent:Button Header="构建查询" Command="SaveAs" IsEnabled="False" Visibility="Hidden"  Name="SaveAs"
                                       Icon="Resources\Images\32x32\application\save_as.png"
                                       LargeIcon="Resources\Images\32x32\application\save_as.png" />
                        </Fluent:BackstageTabControl>
                    </Fluent:Backstage>
                </Fluent:Ribbon.Menu>
                <Fluent:RibbonTabItem Header="项目">
                    <Fluent:RibbonGroupBox Header="View">
                        <ComboBox SelectedIndex="0"
                              MinWidth="50"
                              Width="Auto"
                              DisplayMemberPath="Description"
                              SelectedValuePath="Description"
                              ItemsSource="{Binding ElementName=Container, Path=LocalizationModel.AvailableLanguages}"
                              SelectedItem="{Binding ElementName=Container, Path=LocalizationModel.CurrentLanguage, Mode=TwoWay}" />
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="工艺开发" Tag="HomeTech" Name="tabArticle"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="生产开发工艺"  Name="gpArticle"
                                        IsEnabled="False" Visibility="Hidden"
                                       IsLauncherVisible="True">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="单证" Name="gpDoc"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="生产" Name="gpProd"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="销售" Name="gbSales">

                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="销售部" Name="tabSales"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="销售部" Name="gpSales"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="计划部" Name="tabPlan"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="计划部" Name="gpPlan"  IsEnabled="False" Visibility="Hidden">

                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="原料供应" Name="gpMaterilaSupply">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="仓库" Name="gpMaterial">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="统计" Name="tabChart"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="成品" Name="gpFinish">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="浆纱" Name="gpSizing"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="染纱" Name="gpDye">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="生产" Name="gpProduction">
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="产量" Name="gpOutput">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="采购部" Name="tabPurchase"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox  Header="采购部" Tag="HomeEK"  IsEnabled="False" Name="gpEK" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="仓库" Name="tabWarehouse"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="仓库报表"  Name="gpWarehouse" Tag="HomeWB"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="质检" Name="tabQuality"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="坯布" Name="gpWS03"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="财务" Name="tabFinance"  IsEnabled="False" Visibility="Hidden">
                    <Fluent:RibbonGroupBox Header="进销存" Name="gpINOUTINV"  IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
                <Fluent:RibbonTabItem Header="系统设定"  IsEnabled="False" Visibility="Hidden" Name="tabSystem">
                    <Fluent:RibbonGroupBox Header="配色方案"  IsEnabled="False" Visibility="Hidden">
                        <ComboBox x:Name="themes" Width="150" Height="20" SelectionChanged="themes_SelectionChanged" SelectedIndex="0" />
                    </Fluent:RibbonGroupBox>
                    <Fluent:RibbonGroupBox Header="系统"  Name="gpSystem" IsEnabled="False" Visibility="Hidden">
                    </Fluent:RibbonGroupBox>
                </Fluent:RibbonTabItem>
            </Fluent:Ribbon>
            <gui:StatusBar Grid.Row="3"
                DockPanel.Dock="Bottom"
                        Height="30"
                        x:Name="MainStatusBar" />
        <Expander Grid.Row="2"
                DockPanel.Dock="Bottom"
                  MaxHeight="250"
                  ExpandDirection="Down"
                  Header="数据服务">
                <exc:ExTabControl Name="TAB_DOWN">
                    <TabItem Header="日志"
                         Name="LogExplorerDock">
                        <gui:EventLogExplorer Name="_LogExplorerDock"
                                          HorizontalAlignment="Stretch"
                                          Width="Auto"
                                          VerticalAlignment="Stretch"></gui:EventLogExplorer>
                    </TabItem>
                </exc:ExTabControl>
            </Expander>
        
    </Grid>
</Window> 